package com.simple.datax.db.mybatis.model;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 
 * @author paladin
 *
 */
public class DataxSendChannel implements Serializable {
	private Long id;

	private String channelDesc;

	private String msgFormat;

	private String msgCharset;

	private String msgType;

	private String communType;

	private String communParam;

	private Short flag;

	private Date time;

	private static final long serialVersionUID = 1L;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getChannelDesc() {
		return channelDesc;
	}

	public void setChannelDesc(String channelDesc) {
		this.channelDesc = channelDesc == null ? null : channelDesc.trim();
	}

	public String getMsgFormat() {
		return msgFormat;
	}

	public void setMsgFormat(String msgFormat) {
		this.msgFormat = msgFormat == null ? null : msgFormat.trim();
	}

	public String getMsgCharset() {
		return msgCharset;
	}

	public void setMsgCharset(String msgCharset) {
		this.msgCharset = msgCharset == null ? null : msgCharset.trim();
	}

	public String getMsgType() {
		return msgType;
	}

	public void setMsgType(String msgType) {
		this.msgType = msgType == null ? null : msgType.trim();
	}

	public String getCommunType() {
		return communType;
	}

	public void setCommunType(String communType) {
		this.communType = communType == null ? null : communType.trim();
	}

	public String getCommunParam() {
		return communParam;
	}

	public void setCommunParam(String communParam) {
		this.communParam = communParam == null ? null : communParam.trim();
	}

	public Short getFlag() {
		return flag;
	}

	public void setFlag(Short flag) {
		this.flag = flag;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		DataxSendChannel other = (DataxSendChannel) that;
		return (this.getId() == null ? other.getId() == null : this.getId()
				.equals(other.getId()))
				&& (this.getChannelDesc() == null ? other.getChannelDesc() == null
						: this.getChannelDesc().equals(other.getChannelDesc()))
				&& (this.getMsgFormat() == null ? other.getMsgFormat() == null
						: this.getMsgFormat().equals(other.getMsgFormat()))
				&& (this.getMsgCharset() == null ? other.getMsgCharset() == null
						: this.getMsgCharset().equals(other.getMsgCharset()))
				&& (this.getMsgType() == null ? other.getMsgType() == null
						: this.getMsgType().equals(other.getMsgType()))
				&& (this.getCommunType() == null ? other.getCommunType() == null
						: this.getCommunType().equals(other.getCommunType()))
				&& (this.getCommunParam() == null ? other.getCommunParam() == null
						: this.getCommunParam().equals(other.getCommunParam()))
				&& (this.getFlag() == null ? other.getFlag() == null : this
						.getFlag().equals(other.getFlag()))
				&& (this.getTime() == null ? other.getTime() == null : this
						.getTime().equals(other.getTime()));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
		result = prime
				* result
				+ ((getChannelDesc() == null) ? 0 : getChannelDesc().hashCode());
		result = prime * result
				+ ((getMsgFormat() == null) ? 0 : getMsgFormat().hashCode());
		result = prime * result
				+ ((getMsgCharset() == null) ? 0 : getMsgCharset().hashCode());
		result = prime * result
				+ ((getMsgType() == null) ? 0 : getMsgType().hashCode());
		result = prime * result
				+ ((getCommunType() == null) ? 0 : getCommunType().hashCode());
		result = prime
				* result
				+ ((getCommunParam() == null) ? 0 : getCommunParam().hashCode());
		result = prime * result
				+ ((getFlag() == null) ? 0 : getFlag().hashCode());
		result = prime * result
				+ ((getTime() == null) ? 0 : getTime().hashCode());
		return result;
	}
    
    public String toString() {
		return ReflectionToStringBuilder.toString(this,
				ToStringStyle.SHORT_PREFIX_STYLE);
	}
}